package XMLread;

import com.google.android.maps.GeoPoint;

/**
 * This object represents a exit in a building.
 */
public class Exit {
	private String exitID;
	private GeoPoint geopoint;
	private double latitude;
	private double longitude;
	
	/**
	 * Constructor for this exit object.
	 * @param id the ID of this exit
	 * @param latit the latitude coordinate of this exit
	 * @param longit the longitude coordinate of this exit
	 */
	public Exit(String id, double latit, double longit){
		this.setExitID(id);
		latitude = latit;
		longitude = longit;
		setGeopoint(latit, longit);
	}
	
	/**
	 * Returns the ID of this exit.
	 * @return the ID of this exit.
	 */
	public String getExitID() {
		return exitID;
	}
	
	/**
	 * Set the ID of this exit.
	 * @param the ID of this exit.
	 */
	public void setExitID(String exitID) {
		this.exitID = exitID;
	}
	
	/**
	 * Sets the position of this exit.
	 * @param latitude the new value representing the latitude coordinate of this exit.
	 * @param longitude the new value representing the longitude coordinate of this exit.
	 */
	public void setGeopoint(double latitude, double longitude) {
		this.geopoint = new GeoPoint((int) (latitude * 1e6), (int) (longitude * 1e6));
	}
	
	/**
	 * Returns the latitude of this exit.
	 * @return the latitude of this exit.
	 */
	public double getLat(){
		return latitude;
	}
	
	/**
	 * Returns the longitude of this exit.
	 * @return the longitude of this exit.
	 */
	public double getLong(){
		return longitude;
	}
	
	/**
	 * Returns the location of this exit as a GeoPoint.
	 * @return the GeoPoint representing the location of this exit.
	 */
	public GeoPoint getGeopoint(){
		return geopoint;
	}
}
